import request from '@/utils/request'

// 查询会议室列表
export function listMeetingRoom(query) {
  return request({
    url: '/meetingroom/room/list',
    method: 'get',
    params: query
  })
}

/**
 * 新增会议室
 * @param {Object} data 会议室信息
 * @returns {Promise}
 */
export function addMeetingRoom(data) {
  return request({
    url: '/meetingroom/room',
    method: 'post',
    data
  })
}

/**
 * 获取会议室详情
 * @param {number|string} roomId 会议室ID
 * @returns {Promise}
 */
export function getMeetingRoom(roomId) {
  return request({
    url: `/meetingroom/room/${roomId}`,
    method: 'get'
  })
}

/**
 * 修改会议室
 * @param {Object} data 会议室信息
 * @returns {Promise}
 */
export function updateMeetingRoom(data) {
  return request({
    url: '/meetingroom/room',
    method: 'put',
    data
  })
} 

/**
 * 删除会议室
 * @param {number|string|Array} roomIds 会议室ID或ID数组
 * @returns {Promise}
 */
export function deleteMeetingRoom(roomIds) {
    return request({
      url: `/meetingroom/room/${roomIds}`,
      method: 'delete'
    })
  }